package com.wp.service;
import com.wp.dao.UserDao;
import com.wp.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class UserServiceImpl implements UserService {
    @Autowired(required = false)

//    @Resource(name = "userDao")
      private UserDao userDao;
//    public UserServiceImpl() {
//        System.out.println("无参构造");
//    }

//     构造方法
//    public UserServiceImpl(UserDao userDao) {
//        System.out.println("构造方法");
//        this.userDao = userDao;
//    }

    public void save() {
        System.out.println("main service static");
    }

    public User findById(Integer id) { return userDao.findById(id); }
//
//    public void setUserDao(UserDao userDao) {
//        this.userDao = userDao;
//    }
}
